{literal}
  <script type="text/javascript">
<!--
function confirmDelete(articleId) {
if (confirm("This will delete this page. Continue?"))
  {/literal}
document.location = "{$pagename}&action=delete&site={$sitename}&id=" + articleId;
{literal}
}
//-->
</script>
  {/literal}
{if $action!="edit" && $action!="new"}
{if $numcontent > 0}
<h2>Content Pages for {$sitename}</h2>
<div align="left"><input type="button" class="button" value="Add New Page" onclick="window.location='{$pagename}&amp;action=new&amp;site={$sitename}'" />&nbsp;
<input type="button" class="button" value="Menu Manager" onclick="window.location='admin.php?page=submenu&amp;site={$sitename}'" />
</div>
	<table width="100%" border="0" cellpadding="4" cellspacing="1" class="table">
  <tr valign="top"> 
    <th width="10%" class="smallhead">Action</th>
    <th width="12%" class="smallhead">Name</th>
  </tr>
 {section name=contentloop loop=$numcontent}
	  <tr valign="middle"> 
		<td width="10%"  class="text"><a href="{$pagename}&amp;id={$content[contentloop].id}&amp;action=edit&amp;site={$sitename}"><img src="{$tempdir}admin/images/edit.gif" border="0" alt="Edit {$content[contentloop].name}" title="Edit {$content[contentloop].name}" /></a>{if $content[contentloop].name != "frontpage"} - <a href="javascript:confirmDelete({$content[contentloop].id})">
        <img src="{$tempdir}admin/images/delete.gif" border="0" alt="Delete {$content[contentloop].name}" title="Delete {$content[contentloop].name}" /></a>{/if}</td>
		<td width="12%" class="text">{$content[contentloop].name}</td>
	  </tr>  
	{/section}
</table>
{else}
<div align="center">No content for {$sitename}</div>
{/if}
<div align="left"><input type="button" class="button" value="Add New Page" onclick="window.location='{$pagename}&amp;action=new&amp;site={$sitename}'" />&nbsp;
<input type="button" class="button" value="Menu Manager" onclick="window.location='admin.php?page=submenu&amp;site={$sitename}'" />&nbsp;<input type="button" class="button" value="Sub Sites" onclick="window.location='admin.php?page=subsite'" /></div>
{elseif $action=="new"}
<form name="Content" method="post" action="{$editFormAction}">
	<table width="100%" border="0" cellpadding="4" cellspacing="1" class="table">
    <tr> 
      <th colspan="2" class="bighead">Content Admin</th>
    </tr>
    <tr valign="middle">
      <td class="text"><div align="right">Name:</div></td>
      <td class="text"><div align="left"><input name="name" type="text" id="name" size="100" maxlength="50" class="inputbox" /></div></td>
    </tr>
    <tr valign="middle"> 
	 <td valign="top" class="text"><div align="right">Content:</div></td>
      <td width="89%" class="text"> 
                  <textarea id="editor" name="editor" style="width:100%; height:50em" class="inputbox"></textarea>
	  </td>
    </tr>
    <tr valign="middle"> 
      <td colspan="2" class="text"> 
        <div align="center"> 
		  <input type="submit" name="Submit" value="Submit" class="button" />
      <input name="Cancel" type="button" id="Cancel" value="Cancel" onclick="window.location = '{$pagename}&amp;site={$sitename}';" class="button" />
          </div>
      </td>
    </tr>
  </table>
</form>
{else}
<form name="Content" method="post" action="{$editFormAction}">
	<table width="100%" border="0" cellpadding="4" cellspacing="1" class="table">
    <tr> 
      <th class="bighead" colspan="2">Content for: {$item.name}</th>
    </tr>
    <tr valign="middle"> 
      <td width="89%" colspan="2" class="text"> 
                  <textarea id="editor" name="editor" style="width:100%; height:50em" class="inputbox">{$item.content}</textarea>
	  </td>
    </tr>
    <tr valign="middle"> 
      <td class="text" colspan="2"> 
		  <input type="submit" name="Submit" value="Update" class="button" />
      <input name="Cancel" type="button" id="Cancel" value="Cancel" onclick="window.location = '{$pagename}&amp;site={$sitename}';" class="button" />
      </td>
    </tr>
  </table>
</form>
{/if}
